void get_pwd_name(MINODE* wd, char path[MAX_PATH_LENGTH])
{
	if (wd == rootInode)
		strcpy(path, "/");
	else
	{
		ulong parentNum = 0;
		char curName[EXT2_MAX_FILE_LENGTH];
		MINODE* parent;
		
		if ((wd->location.inodeNum == 2) && (wd != rootInode))
		{
			int i;
			for (i = 0; i < NUM_MOUNTS; i++)
			{
				if (mountTable[i].handle == wd->location.deviceHandle)
				{
					wd = get_inode(mountTable[i].mountedInode->location.deviceHandle,
							mountTable[i].mountedInode->location.inodeNum);
					break;
				}
			}
		}
		
		parentNum = get_inode_parent_number(wd);
		if (parentNum == -1)
			return;

		get_inode_name(wd, parentNum, curName);
			
		parent = get_inode(wd->location.deviceHandle, parentNum);
		if (parent == 0)
			return;
			
		/*if (parent->location.inodeNum == 2)
		{
			int i;
			for (i = 0; i < NUM_MOUNTS; i++)
			{
				if (mountTable[i].handle == parent->location.deviceHandle)
				{
					put_inode(parent);
					parent = get_inode(mountTable[i].mountedInode->location.deviceHandle,
						mountTable[i].mountedInode->location.inodeNum);
				}
			}
		}*/
		
		get_pwd_name(parent, path);
		
		strcat(path, curName);
		strcat(path, "/");
		
		put_inode(parent);
	}
}

int do_pwd(char* notUsed)
{
	char pwd[MAX_PATH_LENGTH];
	get_pwd_name(runningProc->cwd, pwd);
	printf("%s\n\n", pwd);
	return 1;
}
